package com.example.lx5_22.news

import androidx.lifecycle.MutableLiveData
import com.example.base.entity.NewsEntity
import com.example.base.mvvm.BaseViewModel
import com.example.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject


@HiltViewModel
class NewsViewModel @Inject constructor(val apiService: ApiService) : BaseViewModel() {
    val newsData = MutableLiveData<NewsEntity>()

    fun news(){
        httpRequest({apiService.getNews()},newsData::postValue)
    }
}